﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using PAT.Entities;
using PAT.Data;

#endregion

namespace PAT.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="PatOrdenTrabajoProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class PatOrdenTrabajoProviderBaseCore : EntityProviderBase<PAT.Entities.PatOrdenTrabajo, PAT.Entities.PatOrdenTrabajoKey>
	{		
		#region Get from Many To Many Relationship Functions
		#region GetByIdAccesorioFromPatOrdenTrabajoAccesorio
		
		/// <summary>
		///		Gets PAT_ORDEN_TRABAJO objects from the datasource by ID_ACCESORIO in the
		///		PAT_ORDEN_TRABAJO_ACCESORIO table. Table PAT_ORDEN_TRABAJO is related to table PAT_ACCESORIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_ACCESORIO table.
		/// </summary>
		/// <param name="_idAccesorio"></param>
		/// <returns>Returns a typed collection of PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdAccesorioFromPatOrdenTrabajoAccesorio(System.Int32 _idAccesorio)
		{
			int count = -1;
			return GetByIdAccesorioFromPatOrdenTrabajoAccesorio(null,_idAccesorio, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatOrdenTrabajo objects from the datasource by ID_ACCESORIO in the
		///		PAT_ORDEN_TRABAJO_ACCESORIO table. Table PAT_ORDEN_TRABAJO is related to table PAT_ACCESORIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_ACCESORIO table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idAccesorio"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdAccesorioFromPatOrdenTrabajoAccesorio(System.Int32 _idAccesorio, int start, int pageLength)
		{
			int count = -1;
			return GetByIdAccesorioFromPatOrdenTrabajoAccesorio(null, _idAccesorio, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_ACCESORIO in the
		///		PAT_ORDEN_TRABAJO_ACCESORIO table. Table PAT_ORDEN_TRABAJO is related to table PAT_ACCESORIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_ACCESORIO table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idAccesorio"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdAccesorioFromPatOrdenTrabajoAccesorio(TransactionManager transactionManager, System.Int32 _idAccesorio)
		{
			int count = -1;
			return GetByIdAccesorioFromPatOrdenTrabajoAccesorio(transactionManager, _idAccesorio, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_ACCESORIO in the
		///		PAT_ORDEN_TRABAJO_ACCESORIO table. Table PAT_ORDEN_TRABAJO is related to table PAT_ACCESORIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_ACCESORIO table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idAccesorio"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdAccesorioFromPatOrdenTrabajoAccesorio(TransactionManager transactionManager, System.Int32 _idAccesorio,int start, int pageLength)
		{
			int count = -1;
			return GetByIdAccesorioFromPatOrdenTrabajoAccesorio(transactionManager, _idAccesorio, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_ACCESORIO in the
		///		PAT_ORDEN_TRABAJO_ACCESORIO table. Table PAT_ORDEN_TRABAJO is related to table PAT_ACCESORIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_ACCESORIO table.
		/// </summary>
		/// <param name="_idAccesorio"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdAccesorioFromPatOrdenTrabajoAccesorio(System.Int32 _idAccesorio,int start, int pageLength, out int count)
		{
			
			return GetByIdAccesorioFromPatOrdenTrabajoAccesorio(null, _idAccesorio, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ORDEN_TRABAJO objects from the datasource by ID_ACCESORIO in the
		///		PAT_ORDEN_TRABAJO_ACCESORIO table. Table PAT_ORDEN_TRABAJO is related to table PAT_ACCESORIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_ACCESORIO table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idAccesorio"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdAccesorioFromPatOrdenTrabajoAccesorio(TransactionManager transactionManager,System.Int32 _idAccesorio, int start, int pageLength, out int count);
		
		#endregion GetByIdAccesorioFromPatOrdenTrabajoAccesorio
		
		#region GetByIdKitFromPatOrdenTrabajoKit
		
		/// <summary>
		///		Gets PAT_ORDEN_TRABAJO objects from the datasource by ID_KIT in the
		///		PAT_ORDEN_TRABAJO_KIT table. Table PAT_ORDEN_TRABAJO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_KIT table.
		/// </summary>
		/// <param name="_idKit"></param>
		/// <returns>Returns a typed collection of PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdKitFromPatOrdenTrabajoKit(System.Int32 _idKit)
		{
			int count = -1;
			return GetByIdKitFromPatOrdenTrabajoKit(null,_idKit, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatOrdenTrabajo objects from the datasource by ID_KIT in the
		///		PAT_ORDEN_TRABAJO_KIT table. Table PAT_ORDEN_TRABAJO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_KIT table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idKit"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdKitFromPatOrdenTrabajoKit(System.Int32 _idKit, int start, int pageLength)
		{
			int count = -1;
			return GetByIdKitFromPatOrdenTrabajoKit(null, _idKit, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_KIT in the
		///		PAT_ORDEN_TRABAJO_KIT table. Table PAT_ORDEN_TRABAJO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_KIT table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idKit"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdKitFromPatOrdenTrabajoKit(TransactionManager transactionManager, System.Int32 _idKit)
		{
			int count = -1;
			return GetByIdKitFromPatOrdenTrabajoKit(transactionManager, _idKit, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_KIT in the
		///		PAT_ORDEN_TRABAJO_KIT table. Table PAT_ORDEN_TRABAJO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_KIT table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idKit"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdKitFromPatOrdenTrabajoKit(TransactionManager transactionManager, System.Int32 _idKit,int start, int pageLength)
		{
			int count = -1;
			return GetByIdKitFromPatOrdenTrabajoKit(transactionManager, _idKit, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_KIT in the
		///		PAT_ORDEN_TRABAJO_KIT table. Table PAT_ORDEN_TRABAJO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_KIT table.
		/// </summary>
		/// <param name="_idKit"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdKitFromPatOrdenTrabajoKit(System.Int32 _idKit,int start, int pageLength, out int count)
		{
			
			return GetByIdKitFromPatOrdenTrabajoKit(null, _idKit, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ORDEN_TRABAJO objects from the datasource by ID_KIT in the
		///		PAT_ORDEN_TRABAJO_KIT table. Table PAT_ORDEN_TRABAJO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_KIT table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idKit"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdKitFromPatOrdenTrabajoKit(TransactionManager transactionManager,System.Int32 _idKit, int start, int pageLength, out int count);
		
		#endregion GetByIdKitFromPatOrdenTrabajoKit
		
		#region GetByIdOperacionFromPatOrdenTrabajoOperacion
		
		/// <summary>
		///		Gets PAT_ORDEN_TRABAJO objects from the datasource by ID_OPERACION in the
		///		PAT_ORDEN_TRABAJO_OPERACION table. Table PAT_ORDEN_TRABAJO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_OPERACION table.
		/// </summary>
		/// <param name="_idOperacion"></param>
		/// <returns>Returns a typed collection of PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdOperacionFromPatOrdenTrabajoOperacion(System.Int32 _idOperacion)
		{
			int count = -1;
			return GetByIdOperacionFromPatOrdenTrabajoOperacion(null,_idOperacion, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatOrdenTrabajo objects from the datasource by ID_OPERACION in the
		///		PAT_ORDEN_TRABAJO_OPERACION table. Table PAT_ORDEN_TRABAJO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_OPERACION table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idOperacion"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdOperacionFromPatOrdenTrabajoOperacion(System.Int32 _idOperacion, int start, int pageLength)
		{
			int count = -1;
			return GetByIdOperacionFromPatOrdenTrabajoOperacion(null, _idOperacion, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_OPERACION in the
		///		PAT_ORDEN_TRABAJO_OPERACION table. Table PAT_ORDEN_TRABAJO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_OPERACION table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idOperacion"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdOperacionFromPatOrdenTrabajoOperacion(TransactionManager transactionManager, System.Int32 _idOperacion)
		{
			int count = -1;
			return GetByIdOperacionFromPatOrdenTrabajoOperacion(transactionManager, _idOperacion, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_OPERACION in the
		///		PAT_ORDEN_TRABAJO_OPERACION table. Table PAT_ORDEN_TRABAJO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_OPERACION table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idOperacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdOperacionFromPatOrdenTrabajoOperacion(TransactionManager transactionManager, System.Int32 _idOperacion,int start, int pageLength)
		{
			int count = -1;
			return GetByIdOperacionFromPatOrdenTrabajoOperacion(transactionManager, _idOperacion, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_OPERACION in the
		///		PAT_ORDEN_TRABAJO_OPERACION table. Table PAT_ORDEN_TRABAJO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_OPERACION table.
		/// </summary>
		/// <param name="_idOperacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdOperacionFromPatOrdenTrabajoOperacion(System.Int32 _idOperacion,int start, int pageLength, out int count)
		{
			
			return GetByIdOperacionFromPatOrdenTrabajoOperacion(null, _idOperacion, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ORDEN_TRABAJO objects from the datasource by ID_OPERACION in the
		///		PAT_ORDEN_TRABAJO_OPERACION table. Table PAT_ORDEN_TRABAJO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_OPERACION table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idOperacion"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdOperacionFromPatOrdenTrabajoOperacion(TransactionManager transactionManager,System.Int32 _idOperacion, int start, int pageLength, out int count);
		
		#endregion GetByIdOperacionFromPatOrdenTrabajoOperacion
		
		#region GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje
		
		/// <summary>
		///		Gets PAT_ORDEN_TRABAJO objects from the datasource by ID_GRUPO_PERITAJE in the
		///		PAT_ORDEN_TRABAJO_PERITAJE table. Table PAT_ORDEN_TRABAJO is related to table PAT_ITEM_PERITAJE
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_PERITAJE table.
		/// </summary>
		/// <param name="_idGrupoPeritaje"></param>
		/// <param name="_idItemPeritaje"></param>
		/// <returns>Returns a typed collection of PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(System.Int16 _idGrupoPeritaje, System.Int16 _idItemPeritaje)
		{
			int count = -1;
			return GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(null,_idGrupoPeritaje, _idItemPeritaje, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatOrdenTrabajo objects from the datasource by ID_GRUPO_PERITAJE in the
		///		PAT_ORDEN_TRABAJO_PERITAJE table. Table PAT_ORDEN_TRABAJO is related to table PAT_ITEM_PERITAJE
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_PERITAJE table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idGrupoPeritaje"></param>
		/// <param name="_idItemPeritaje"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(System.Int16 _idGrupoPeritaje, System.Int16 _idItemPeritaje, int start, int pageLength)
		{
			int count = -1;
			return GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(null, _idGrupoPeritaje, _idItemPeritaje, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_GRUPO_PERITAJE in the
		///		PAT_ORDEN_TRABAJO_PERITAJE table. Table PAT_ORDEN_TRABAJO is related to table PAT_ITEM_PERITAJE
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_PERITAJE table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idGrupoPeritaje"></param>
		/// <param name="_idItemPeritaje"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(TransactionManager transactionManager, System.Int16 _idGrupoPeritaje, System.Int16 _idItemPeritaje)
		{
			int count = -1;
			return GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(transactionManager, _idGrupoPeritaje, _idItemPeritaje, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_GRUPO_PERITAJE in the
		///		PAT_ORDEN_TRABAJO_PERITAJE table. Table PAT_ORDEN_TRABAJO is related to table PAT_ITEM_PERITAJE
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_PERITAJE table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idGrupoPeritaje"></param>
		/// <param name="_idItemPeritaje"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(TransactionManager transactionManager, System.Int16 _idGrupoPeritaje, System.Int16 _idItemPeritaje,int start, int pageLength)
		{
			int count = -1;
			return GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(transactionManager, _idGrupoPeritaje, _idItemPeritaje, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_GRUPO_PERITAJE in the
		///		PAT_ORDEN_TRABAJO_PERITAJE table. Table PAT_ORDEN_TRABAJO is related to table PAT_ITEM_PERITAJE
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_PERITAJE table.
		/// </summary>
		/// <param name="_idGrupoPeritaje"></param>
		/// <param name="_idItemPeritaje"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(System.Int16 _idGrupoPeritaje, System.Int16 _idItemPeritaje,int start, int pageLength, out int count)
		{
			
			return GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(null, _idGrupoPeritaje, _idItemPeritaje, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ORDEN_TRABAJO objects from the datasource by ID_GRUPO_PERITAJE in the
		///		PAT_ORDEN_TRABAJO_PERITAJE table. Table PAT_ORDEN_TRABAJO is related to table PAT_ITEM_PERITAJE
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_PERITAJE table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idGrupoPeritaje"></param>
		/// <param name="_idItemPeritaje"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje(TransactionManager transactionManager,System.Int16 _idGrupoPeritaje, System.Int16 _idItemPeritaje, int start, int pageLength, out int count);
		
		#endregion GetByIdGrupoPeritajeIdItemPeritajeFromPatOrdenTrabajoPeritaje
		
		#region GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia
		
		/// <summary>
		///		Gets PAT_ORDEN_TRABAJO objects from the datasource by ID_DOCUMENTO_TRANSFERENCIA in the
		///		PAT_ORDEN_TRABAJO_TRANSFERENCIA table. Table PAT_ORDEN_TRABAJO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_TRANSFERENCIA table.
		/// </summary>
		/// <param name="_idDocumentoTransferencia"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <returns>Returns a typed collection of PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(System.Int32 _idDocumentoTransferencia, System.Int32 _numeroTransferencia)
		{
			int count = -1;
			return GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(null,_idDocumentoTransferencia, _numeroTransferencia, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatOrdenTrabajo objects from the datasource by ID_DOCUMENTO_TRANSFERENCIA in the
		///		PAT_ORDEN_TRABAJO_TRANSFERENCIA table. Table PAT_ORDEN_TRABAJO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_TRANSFERENCIA table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idDocumentoTransferencia"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(System.Int32 _idDocumentoTransferencia, System.Int32 _numeroTransferencia, int start, int pageLength)
		{
			int count = -1;
			return GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(null, _idDocumentoTransferencia, _numeroTransferencia, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_DOCUMENTO_TRANSFERENCIA in the
		///		PAT_ORDEN_TRABAJO_TRANSFERENCIA table. Table PAT_ORDEN_TRABAJO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_TRANSFERENCIA table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumentoTransferencia"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(TransactionManager transactionManager, System.Int32 _idDocumentoTransferencia, System.Int32 _numeroTransferencia)
		{
			int count = -1;
			return GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(transactionManager, _idDocumentoTransferencia, _numeroTransferencia, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_DOCUMENTO_TRANSFERENCIA in the
		///		PAT_ORDEN_TRABAJO_TRANSFERENCIA table. Table PAT_ORDEN_TRABAJO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_TRANSFERENCIA table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumentoTransferencia"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(TransactionManager transactionManager, System.Int32 _idDocumentoTransferencia, System.Int32 _numeroTransferencia,int start, int pageLength)
		{
			int count = -1;
			return GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(transactionManager, _idDocumentoTransferencia, _numeroTransferencia, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatOrdenTrabajo objects from the datasource by ID_DOCUMENTO_TRANSFERENCIA in the
		///		PAT_ORDEN_TRABAJO_TRANSFERENCIA table. Table PAT_ORDEN_TRABAJO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_TRANSFERENCIA table.
		/// </summary>
		/// <param name="_idDocumentoTransferencia"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ORDEN_TRABAJO objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(System.Int32 _idDocumentoTransferencia, System.Int32 _numeroTransferencia,int start, int pageLength, out int count)
		{
			
			return GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(null, _idDocumentoTransferencia, _numeroTransferencia, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ORDEN_TRABAJO objects from the datasource by ID_DOCUMENTO_TRANSFERENCIA in the
		///		PAT_ORDEN_TRABAJO_TRANSFERENCIA table. Table PAT_ORDEN_TRABAJO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_ORDEN_TRABAJO_TRANSFERENCIA table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idDocumentoTransferencia"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia(TransactionManager transactionManager,System.Int32 _idDocumentoTransferencia, System.Int32 _numeroTransferencia, int start, int pageLength, out int count);
		
		#endregion GetByIdDocumentoTransferenciaNumeroTransferenciaFromPatOrdenTrabajoTransferencia
		
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, PAT.Entities.PatOrdenTrabajoKey key)
		{
			return Delete(transactionManager, key.IdDocumento, key.NumeroOrden);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="_idDocumento">. Primary Key.</param>
		/// <param name="_numeroOrden">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.Int32 _idDocumento, System.Int32 _numeroOrden)
		{
			return Delete(null, _idDocumento, _numeroOrden);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumento">. Primary Key.</param>
		/// <param name="_numeroOrden">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.Int32 _idDocumento, System.Int32 _numeroOrden);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CARGO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_CARGO_ORDEN Description: 
		/// </summary>
		/// <param name="_idCargoOrden"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdCargoOrden(System.Byte _idCargoOrden)
		{
			int count = -1;
			return GetByIdCargoOrden(_idCargoOrden, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CARGO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_CARGO_ORDEN Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCargoOrden"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdCargoOrden(TransactionManager transactionManager, System.Byte _idCargoOrden)
		{
			int count = -1;
			return GetByIdCargoOrden(transactionManager, _idCargoOrden, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CARGO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_CARGO_ORDEN Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCargoOrden"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdCargoOrden(TransactionManager transactionManager, System.Byte _idCargoOrden, int start, int pageLength)
		{
			int count = -1;
			return GetByIdCargoOrden(transactionManager, _idCargoOrden, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CARGO_ORDEN key.
		///		fkPatOrdenTrabajoPatCargoOrden Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idCargoOrden"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdCargoOrden(System.Byte _idCargoOrden, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdCargoOrden(null, _idCargoOrden, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CARGO_ORDEN key.
		///		fkPatOrdenTrabajoPatCargoOrden Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idCargoOrden"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdCargoOrden(System.Byte _idCargoOrden, int start, int pageLength,out int count)
		{
			return GetByIdCargoOrden(null, _idCargoOrden, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CARGO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_CARGO_ORDEN Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCargoOrden"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdCargoOrden(TransactionManager transactionManager, System.Byte _idCargoOrden, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CLIENTE key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_CLIENTE Description: 
		/// </summary>
		/// <param name="_idCliente"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdCliente(System.Int32 _idCliente)
		{
			int count = -1;
			return GetByIdCliente(_idCliente, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CLIENTE key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_CLIENTE Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCliente"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdCliente(TransactionManager transactionManager, System.Int32 _idCliente)
		{
			int count = -1;
			return GetByIdCliente(transactionManager, _idCliente, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CLIENTE key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_CLIENTE Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCliente"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdCliente(TransactionManager transactionManager, System.Int32 _idCliente, int start, int pageLength)
		{
			int count = -1;
			return GetByIdCliente(transactionManager, _idCliente, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CLIENTE key.
		///		fkPatOrdenTrabajoPatCliente Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idCliente"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdCliente(System.Int32 _idCliente, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdCliente(null, _idCliente, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CLIENTE key.
		///		fkPatOrdenTrabajoPatCliente Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idCliente"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdCliente(System.Int32 _idCliente, int start, int pageLength,out int count)
		{
			return GetByIdCliente(null, _idCliente, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_CLIENTE key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_CLIENTE Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCliente"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdCliente(TransactionManager transactionManager, System.Int32 _idCliente, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_DOCUMENTO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_DOCUMENTO Description: 
		/// </summary>
		/// <param name="_idDocumento"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdDocumento(System.Int32 _idDocumento)
		{
			int count = -1;
			return GetByIdDocumento(_idDocumento, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_DOCUMENTO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_DOCUMENTO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumento"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdDocumento(TransactionManager transactionManager, System.Int32 _idDocumento)
		{
			int count = -1;
			return GetByIdDocumento(transactionManager, _idDocumento, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_DOCUMENTO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_DOCUMENTO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumento"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdDocumento(TransactionManager transactionManager, System.Int32 _idDocumento, int start, int pageLength)
		{
			int count = -1;
			return GetByIdDocumento(transactionManager, _idDocumento, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_DOCUMENTO key.
		///		fkPatOrdenTrabajoPatDocumento Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idDocumento"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdDocumento(System.Int32 _idDocumento, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdDocumento(null, _idDocumento, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_DOCUMENTO key.
		///		fkPatOrdenTrabajoPatDocumento Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idDocumento"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdDocumento(System.Int32 _idDocumento, int start, int pageLength,out int count)
		{
			return GetByIdDocumento(null, _idDocumento, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_DOCUMENTO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_DOCUMENTO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumento"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdDocumento(TransactionManager transactionManager, System.Int32 _idDocumento, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_EMPLEADO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_EMPLEADO Description: 
		/// </summary>
		/// <param name="_idRecepcionista"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdRecepcionista(System.Int32 _idRecepcionista)
		{
			int count = -1;
			return GetByIdRecepcionista(_idRecepcionista, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_EMPLEADO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_EMPLEADO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idRecepcionista"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdRecepcionista(TransactionManager transactionManager, System.Int32 _idRecepcionista)
		{
			int count = -1;
			return GetByIdRecepcionista(transactionManager, _idRecepcionista, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_EMPLEADO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_EMPLEADO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idRecepcionista"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdRecepcionista(TransactionManager transactionManager, System.Int32 _idRecepcionista, int start, int pageLength)
		{
			int count = -1;
			return GetByIdRecepcionista(transactionManager, _idRecepcionista, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_EMPLEADO key.
		///		fkPatOrdenTrabajoPatEmpleado Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idRecepcionista"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdRecepcionista(System.Int32 _idRecepcionista, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdRecepcionista(null, _idRecepcionista, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_EMPLEADO key.
		///		fkPatOrdenTrabajoPatEmpleado Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idRecepcionista"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdRecepcionista(System.Int32 _idRecepcionista, int start, int pageLength,out int count)
		{
			return GetByIdRecepcionista(null, _idRecepcionista, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_EMPLEADO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_EMPLEADO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idRecepcionista"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdRecepcionista(TransactionManager transactionManager, System.Int32 _idRecepcionista, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_CITA key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_CITA Description: 
		/// </summary>
		/// <param name="_idEstadoCita"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoCita(System.Byte _idEstadoCita)
		{
			int count = -1;
			return GetByIdEstadoCita(_idEstadoCita, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_CITA key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_CITA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoCita"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdEstadoCita(TransactionManager transactionManager, System.Byte _idEstadoCita)
		{
			int count = -1;
			return GetByIdEstadoCita(transactionManager, _idEstadoCita, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_CITA key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_CITA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoCita"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoCita(TransactionManager transactionManager, System.Byte _idEstadoCita, int start, int pageLength)
		{
			int count = -1;
			return GetByIdEstadoCita(transactionManager, _idEstadoCita, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_CITA key.
		///		fkPatOrdenTrabajoPatEstadoCita Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idEstadoCita"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoCita(System.Byte _idEstadoCita, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdEstadoCita(null, _idEstadoCita, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_CITA key.
		///		fkPatOrdenTrabajoPatEstadoCita Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idEstadoCita"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoCita(System.Byte _idEstadoCita, int start, int pageLength,out int count)
		{
			return GetByIdEstadoCita(null, _idEstadoCita, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_CITA key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_CITA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoCita"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdEstadoCita(TransactionManager transactionManager, System.Byte _idEstadoCita, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_LIQUIDACION key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_LIQUIDACION Description: 
		/// </summary>
		/// <param name="_idEstadoLiquidacion"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoLiquidacion(System.Byte _idEstadoLiquidacion)
		{
			int count = -1;
			return GetByIdEstadoLiquidacion(_idEstadoLiquidacion, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_LIQUIDACION key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_LIQUIDACION Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoLiquidacion"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdEstadoLiquidacion(TransactionManager transactionManager, System.Byte _idEstadoLiquidacion)
		{
			int count = -1;
			return GetByIdEstadoLiquidacion(transactionManager, _idEstadoLiquidacion, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_LIQUIDACION key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_LIQUIDACION Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoLiquidacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoLiquidacion(TransactionManager transactionManager, System.Byte _idEstadoLiquidacion, int start, int pageLength)
		{
			int count = -1;
			return GetByIdEstadoLiquidacion(transactionManager, _idEstadoLiquidacion, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_LIQUIDACION key.
		///		fkPatOrdenTrabajoPatEstadoLiquidacion Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idEstadoLiquidacion"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoLiquidacion(System.Byte _idEstadoLiquidacion, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdEstadoLiquidacion(null, _idEstadoLiquidacion, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_LIQUIDACION key.
		///		fkPatOrdenTrabajoPatEstadoLiquidacion Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idEstadoLiquidacion"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoLiquidacion(System.Byte _idEstadoLiquidacion, int start, int pageLength,out int count)
		{
			return GetByIdEstadoLiquidacion(null, _idEstadoLiquidacion, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_LIQUIDACION key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_LIQUIDACION Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoLiquidacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdEstadoLiquidacion(TransactionManager transactionManager, System.Byte _idEstadoLiquidacion, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_ORDEN Description: 
		/// </summary>
		/// <param name="_idEstadoOrden"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoOrden(System.Byte _idEstadoOrden)
		{
			int count = -1;
			return GetByIdEstadoOrden(_idEstadoOrden, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_ORDEN Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoOrden"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdEstadoOrden(TransactionManager transactionManager, System.Byte _idEstadoOrden)
		{
			int count = -1;
			return GetByIdEstadoOrden(transactionManager, _idEstadoOrden, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_ORDEN Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoOrden"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoOrden(TransactionManager transactionManager, System.Byte _idEstadoOrden, int start, int pageLength)
		{
			int count = -1;
			return GetByIdEstadoOrden(transactionManager, _idEstadoOrden, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_ORDEN key.
		///		fkPatOrdenTrabajoPatEstadoOrden Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idEstadoOrden"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoOrden(System.Byte _idEstadoOrden, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdEstadoOrden(null, _idEstadoOrden, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_ORDEN key.
		///		fkPatOrdenTrabajoPatEstadoOrden Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idEstadoOrden"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdEstadoOrden(System.Byte _idEstadoOrden, int start, int pageLength,out int count)
		{
			return GetByIdEstadoOrden(null, _idEstadoOrden, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_ESTADO_ORDEN Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoOrden"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdEstadoOrden(TransactionManager transactionManager, System.Byte _idEstadoOrden, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_LISTA_PRECIOS_TALLER key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_LISTA_PRECIOS_TALLER Description: 
		/// </summary>
		/// <param name="_idListaPrecios"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdListaPrecios(System.Int32 _idListaPrecios)
		{
			int count = -1;
			return GetByIdListaPrecios(_idListaPrecios, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_LISTA_PRECIOS_TALLER key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_LISTA_PRECIOS_TALLER Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idListaPrecios"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdListaPrecios(TransactionManager transactionManager, System.Int32 _idListaPrecios)
		{
			int count = -1;
			return GetByIdListaPrecios(transactionManager, _idListaPrecios, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_LISTA_PRECIOS_TALLER key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_LISTA_PRECIOS_TALLER Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idListaPrecios"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdListaPrecios(TransactionManager transactionManager, System.Int32 _idListaPrecios, int start, int pageLength)
		{
			int count = -1;
			return GetByIdListaPrecios(transactionManager, _idListaPrecios, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_LISTA_PRECIOS_TALLER key.
		///		fkPatOrdenTrabajoPatListaPreciosTaller Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idListaPrecios"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdListaPrecios(System.Int32 _idListaPrecios, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdListaPrecios(null, _idListaPrecios, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_LISTA_PRECIOS_TALLER key.
		///		fkPatOrdenTrabajoPatListaPreciosTaller Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idListaPrecios"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdListaPrecios(System.Int32 _idListaPrecios, int start, int pageLength,out int count)
		{
			return GetByIdListaPrecios(null, _idListaPrecios, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_LISTA_PRECIOS_TALLER key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_LISTA_PRECIOS_TALLER Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idListaPrecios"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdListaPrecios(TransactionManager transactionManager, System.Int32 _idListaPrecios, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_NIVEL_COMBUSTIBLE key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_NIVEL_COMBUSTIBLE Description: 
		/// </summary>
		/// <param name="_idNivelCombustible"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdNivelCombustible(System.Byte _idNivelCombustible)
		{
			int count = -1;
			return GetByIdNivelCombustible(_idNivelCombustible, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_NIVEL_COMBUSTIBLE key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_NIVEL_COMBUSTIBLE Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idNivelCombustible"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdNivelCombustible(TransactionManager transactionManager, System.Byte _idNivelCombustible)
		{
			int count = -1;
			return GetByIdNivelCombustible(transactionManager, _idNivelCombustible, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_NIVEL_COMBUSTIBLE key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_NIVEL_COMBUSTIBLE Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idNivelCombustible"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdNivelCombustible(TransactionManager transactionManager, System.Byte _idNivelCombustible, int start, int pageLength)
		{
			int count = -1;
			return GetByIdNivelCombustible(transactionManager, _idNivelCombustible, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_NIVEL_COMBUSTIBLE key.
		///		fkPatOrdenTrabajoPatNivelCombustible Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idNivelCombustible"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdNivelCombustible(System.Byte _idNivelCombustible, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdNivelCombustible(null, _idNivelCombustible, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_NIVEL_COMBUSTIBLE key.
		///		fkPatOrdenTrabajoPatNivelCombustible Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idNivelCombustible"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdNivelCombustible(System.Byte _idNivelCombustible, int start, int pageLength,out int count)
		{
			return GetByIdNivelCombustible(null, _idNivelCombustible, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_NIVEL_COMBUSTIBLE key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_NIVEL_COMBUSTIBLE Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idNivelCombustible"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdNivelCombustible(TransactionManager transactionManager, System.Byte _idNivelCombustible, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TALLER key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TALLER Description: 
		/// </summary>
		/// <param name="_idTaller"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTaller(System.Int32 _idTaller)
		{
			int count = -1;
			return GetByIdTaller(_idTaller, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TALLER key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TALLER Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTaller"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdTaller(TransactionManager transactionManager, System.Int32 _idTaller)
		{
			int count = -1;
			return GetByIdTaller(transactionManager, _idTaller, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TALLER key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TALLER Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTaller"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTaller(TransactionManager transactionManager, System.Int32 _idTaller, int start, int pageLength)
		{
			int count = -1;
			return GetByIdTaller(transactionManager, _idTaller, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TALLER key.
		///		fkPatOrdenTrabajoPatTaller Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idTaller"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTaller(System.Int32 _idTaller, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdTaller(null, _idTaller, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TALLER key.
		///		fkPatOrdenTrabajoPatTaller Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idTaller"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTaller(System.Int32 _idTaller, int start, int pageLength,out int count)
		{
			return GetByIdTaller(null, _idTaller, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TALLER key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TALLER Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTaller"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdTaller(TransactionManager transactionManager, System.Int32 _idTaller, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TIPO_PROPIETARIO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TIPO_PROPIETARIO Description: 
		/// </summary>
		/// <param name="_idTipoPropietario"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTipoPropietario(System.Int16 _idTipoPropietario)
		{
			int count = -1;
			return GetByIdTipoPropietario(_idTipoPropietario, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TIPO_PROPIETARIO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TIPO_PROPIETARIO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTipoPropietario"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdTipoPropietario(TransactionManager transactionManager, System.Int16 _idTipoPropietario)
		{
			int count = -1;
			return GetByIdTipoPropietario(transactionManager, _idTipoPropietario, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TIPO_PROPIETARIO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TIPO_PROPIETARIO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTipoPropietario"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTipoPropietario(TransactionManager transactionManager, System.Int16 _idTipoPropietario, int start, int pageLength)
		{
			int count = -1;
			return GetByIdTipoPropietario(transactionManager, _idTipoPropietario, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TIPO_PROPIETARIO key.
		///		fkPatOrdenTrabajoPatTipoPropietario Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idTipoPropietario"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTipoPropietario(System.Int16 _idTipoPropietario, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdTipoPropietario(null, _idTipoPropietario, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TIPO_PROPIETARIO key.
		///		fkPatOrdenTrabajoPatTipoPropietario Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idTipoPropietario"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTipoPropietario(System.Int16 _idTipoPropietario, int start, int pageLength,out int count)
		{
			return GetByIdTipoPropietario(null, _idTipoPropietario, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TIPO_PROPIETARIO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TIPO_PROPIETARIO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTipoPropietario"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdTipoPropietario(TransactionManager transactionManager, System.Int16 _idTipoPropietario, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TRABAJO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TRABAJO_ORDEN Description: 
		/// </summary>
		/// <param name="_idTrabajo"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTrabajo(System.Byte _idTrabajo)
		{
			int count = -1;
			return GetByIdTrabajo(_idTrabajo, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TRABAJO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TRABAJO_ORDEN Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTrabajo"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdTrabajo(TransactionManager transactionManager, System.Byte _idTrabajo)
		{
			int count = -1;
			return GetByIdTrabajo(transactionManager, _idTrabajo, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TRABAJO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TRABAJO_ORDEN Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTrabajo"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTrabajo(TransactionManager transactionManager, System.Byte _idTrabajo, int start, int pageLength)
		{
			int count = -1;
			return GetByIdTrabajo(transactionManager, _idTrabajo, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TRABAJO_ORDEN key.
		///		fkPatOrdenTrabajoPatTrabajoOrden Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idTrabajo"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTrabajo(System.Byte _idTrabajo, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdTrabajo(null, _idTrabajo, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TRABAJO_ORDEN key.
		///		fkPatOrdenTrabajoPatTrabajoOrden Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idTrabajo"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdTrabajo(System.Byte _idTrabajo, int start, int pageLength,out int count)
		{
			return GetByIdTrabajo(null, _idTrabajo, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_TRABAJO_ORDEN key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_TRABAJO_ORDEN Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTrabajo"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdTrabajo(TransactionManager transactionManager, System.Byte _idTrabajo, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_VEHICULO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_VEHICULO Description: 
		/// </summary>
		/// <param name="_idVehiculo"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdVehiculo(System.Int32 _idVehiculo)
		{
			int count = -1;
			return GetByIdVehiculo(_idVehiculo, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_VEHICULO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_VEHICULO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idVehiculo"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		/// <remarks></remarks>
		public TList<PatOrdenTrabajo> GetByIdVehiculo(TransactionManager transactionManager, System.Int32 _idVehiculo)
		{
			int count = -1;
			return GetByIdVehiculo(transactionManager, _idVehiculo, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_VEHICULO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_VEHICULO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idVehiculo"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdVehiculo(TransactionManager transactionManager, System.Int32 _idVehiculo, int start, int pageLength)
		{
			int count = -1;
			return GetByIdVehiculo(transactionManager, _idVehiculo, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_VEHICULO key.
		///		fkPatOrdenTrabajoPatVehiculo Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idVehiculo"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdVehiculo(System.Int32 _idVehiculo, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdVehiculo(null, _idVehiculo, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_VEHICULO key.
		///		fkPatOrdenTrabajoPatVehiculo Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idVehiculo"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public TList<PatOrdenTrabajo> GetByIdVehiculo(System.Int32 _idVehiculo, int start, int pageLength,out int count)
		{
			return GetByIdVehiculo(null, _idVehiculo, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_ORDEN_TRABAJO_PAT_VEHICULO key.
		///		FK_PAT_ORDEN_TRABAJO_PAT_VEHICULO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idVehiculo"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatOrdenTrabajo objects.</returns>
		public abstract TList<PatOrdenTrabajo> GetByIdVehiculo(TransactionManager transactionManager, System.Int32 _idVehiculo, int start, int pageLength, out int count);
		
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override PAT.Entities.PatOrdenTrabajo Get(TransactionManager transactionManager, PAT.Entities.PatOrdenTrabajoKey key, int start, int pageLength)
		{
			return GetByIdDocumentoNumeroOrden(transactionManager, key.IdDocumento, key.NumeroOrden, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_PAT_ORDEN_TRABAJO index.
		/// </summary>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroOrden"></param>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatOrdenTrabajo"/> class.</returns>
		public PAT.Entities.PatOrdenTrabajo GetByIdDocumentoNumeroOrden(System.Int32 _idDocumento, System.Int32 _numeroOrden)
		{
			int count = -1;
			return GetByIdDocumentoNumeroOrden(null,_idDocumento, _numeroOrden, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_ORDEN_TRABAJO index.
		/// </summary>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroOrden"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatOrdenTrabajo"/> class.</returns>
		public PAT.Entities.PatOrdenTrabajo GetByIdDocumentoNumeroOrden(System.Int32 _idDocumento, System.Int32 _numeroOrden, int start, int pageLength)
		{
			int count = -1;
			return GetByIdDocumentoNumeroOrden(null, _idDocumento, _numeroOrden, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_ORDEN_TRABAJO index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroOrden"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatOrdenTrabajo"/> class.</returns>
		public PAT.Entities.PatOrdenTrabajo GetByIdDocumentoNumeroOrden(TransactionManager transactionManager, System.Int32 _idDocumento, System.Int32 _numeroOrden)
		{
			int count = -1;
			return GetByIdDocumentoNumeroOrden(transactionManager, _idDocumento, _numeroOrden, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_ORDEN_TRABAJO index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroOrden"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatOrdenTrabajo"/> class.</returns>
		public PAT.Entities.PatOrdenTrabajo GetByIdDocumentoNumeroOrden(TransactionManager transactionManager, System.Int32 _idDocumento, System.Int32 _numeroOrden, int start, int pageLength)
		{
			int count = -1;
			return GetByIdDocumentoNumeroOrden(transactionManager, _idDocumento, _numeroOrden, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_ORDEN_TRABAJO index.
		/// </summary>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroOrden"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatOrdenTrabajo"/> class.</returns>
		public PAT.Entities.PatOrdenTrabajo GetByIdDocumentoNumeroOrden(System.Int32 _idDocumento, System.Int32 _numeroOrden, int start, int pageLength, out int count)
		{
			return GetByIdDocumentoNumeroOrden(null, _idDocumento, _numeroOrden, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_ORDEN_TRABAJO index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroOrden"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatOrdenTrabajo"/> class.</returns>
		public abstract PAT.Entities.PatOrdenTrabajo GetByIdDocumentoNumeroOrden(TransactionManager transactionManager, System.Int32 _idDocumento, System.Int32 _numeroOrden, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a TList&lt;PatOrdenTrabajo&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="TList&lt;PatOrdenTrabajo&gt;"/></returns>
		public static TList<PatOrdenTrabajo> Fill(IDataReader reader, TList<PatOrdenTrabajo> rows, int start, int pageLength)
		{
			NetTiersProvider currentProvider = DataRepository.Provider;
            bool useEntityFactory = currentProvider.UseEntityFactory;
            bool enableEntityTracking = currentProvider.EnableEntityTracking;
            LoadPolicy currentLoadPolicy = currentProvider.CurrentLoadPolicy;
			Type entityCreationFactoryType = currentProvider.EntityCreationalFactoryType;
			
			// advance to the starting row
			for (int i = 0; i < start; i++)
			{
				if (!reader.Read())
				return rows; // not enough rows, just return
			}
			for (int i = 0; i < pageLength; i++)
			{
				if (!reader.Read())
					break; // we are done
					
				string key = null;
				
				PAT.Entities.PatOrdenTrabajo c = null;
				if (useEntityFactory)
				{
					key = new System.Text.StringBuilder("PatOrdenTrabajo")
					.Append("|").Append((System.Int32)reader[((int)PatOrdenTrabajoColumn.IdDocumento - 1)])
					.Append("|").Append((System.Int32)reader[((int)PatOrdenTrabajoColumn.NumeroOrden - 1)]).ToString();
					c = EntityManager.LocateOrCreate<PatOrdenTrabajo>(
					key.ToString(), // EntityTrackingKey
					"PatOrdenTrabajo",  //Creational Type
					entityCreationFactoryType,  //Factory used to create entity
					enableEntityTracking); // Track this entity?
				}
				else
				{
					c = new PAT.Entities.PatOrdenTrabajo();
				}
				
				if (!enableEntityTracking ||
					c.EntityState == EntityState.Added ||
					(enableEntityTracking &&
					
						(
							(currentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
							(currentLoadPolicy == LoadPolicy.DiscardChanges && c.EntityState != EntityState.Unchanged)
						)
					))
				{
					c.SuppressEntityEvents = true;
					c.IdDocumento = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdDocumento - 1)];
					c.OriginalIdDocumento = c.IdDocumento;
					c.NumeroOrden = (System.Int32)reader[((int)PatOrdenTrabajoColumn.NumeroOrden - 1)];
					c.OriginalNumeroOrden = c.NumeroOrden;
					c.IdVehiculo = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdVehiculo - 1)];
					c.IdCliente = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdCliente - 1)];
					c.IdTipoPropietario = (System.Int16)reader[((int)PatOrdenTrabajoColumn.IdTipoPropietario - 1)];
					c.IdEstadoOrden = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdEstadoOrden - 1)];
					c.IdCargoOrden = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdCargoOrden - 1)];
					c.IdTrabajo = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdTrabajo - 1)];
					c.FechaEntrada = (System.DateTime)reader[((int)PatOrdenTrabajoColumn.FechaEntrada - 1)];
					c.HoraEntrada = (System.DateTime)reader[((int)PatOrdenTrabajoColumn.HoraEntrada - 1)];
					c.FechaCreacion = (System.DateTime)reader[((int)PatOrdenTrabajoColumn.FechaCreacion - 1)];
					c.FechaEstimadaEntrega = (System.DateTime)reader[((int)PatOrdenTrabajoColumn.FechaEstimadaEntrega - 1)];
					c.HoraEstimadaEntrega = (System.DateTime)reader[((int)PatOrdenTrabajoColumn.HoraEstimadaEntrega - 1)];
					c.FechaSalidaTaller = (reader.IsDBNull(((int)PatOrdenTrabajoColumn.FechaSalidaTaller - 1)))?null:(System.DateTime?)reader[((int)PatOrdenTrabajoColumn.FechaSalidaTaller - 1)];
					c.NumeroEntrada = (System.Int32)reader[((int)PatOrdenTrabajoColumn.NumeroEntrada - 1)];
					c.KilometrajeEntrada = (System.Int32)reader[((int)PatOrdenTrabajoColumn.KilometrajeEntrada - 1)];
					c.IdRecepcionista = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdRecepcionista - 1)];
					c.IdTaller = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdTaller - 1)];
					c.NumeroLocker = (reader.IsDBNull(((int)PatOrdenTrabajoColumn.NumeroLocker - 1)))?null:(System.Int32?)reader[((int)PatOrdenTrabajoColumn.NumeroLocker - 1)];
					c.ObservacionesRecepcionista = (System.String)reader[((int)PatOrdenTrabajoColumn.ObservacionesRecepcionista - 1)];
					c.ObservacionesCliente = (System.String)reader[((int)PatOrdenTrabajoColumn.ObservacionesCliente - 1)];
					c.IdListaPrecios = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdListaPrecios - 1)];
					c.IdNivelCombustible = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdNivelCombustible - 1)];
					c.IdEstadoCita = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdEstadoCita - 1)];
					c.FechaLiquidacion = (reader.IsDBNull(((int)PatOrdenTrabajoColumn.FechaLiquidacion - 1)))?null:(System.DateTime?)reader[((int)PatOrdenTrabajoColumn.FechaLiquidacion - 1)];
					c.AceptaEncuesta = (System.Boolean)reader[((int)PatOrdenTrabajoColumn.AceptaEncuesta - 1)];
					c.VehiculoInspeccionadoElevador = (System.Boolean)reader[((int)PatOrdenTrabajoColumn.VehiculoInspeccionadoElevador - 1)];
					c.EntregaPresupuesto = (System.Boolean)reader[((int)PatOrdenTrabajoColumn.EntregaPresupuesto - 1)];
					c.IdEstadoLiquidacion = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdEstadoLiquidacion - 1)];
					c.EsCotizacion = (System.Boolean)reader[((int)PatOrdenTrabajoColumn.EsCotizacion - 1)];
					c.Activo = (System.Boolean)reader[((int)PatOrdenTrabajoColumn.Activo - 1)];
					c.EntityTrackingKey = key;
					c.AcceptChanges();
					c.SuppressEntityEvents = false;
				}
				rows.Add(c);
			}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="PAT.Entities.PatOrdenTrabajo"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatOrdenTrabajo"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, PAT.Entities.PatOrdenTrabajo entity)
		{
			if (!reader.Read()) return;
			
			entity.IdDocumento = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdDocumento - 1)];
			entity.OriginalIdDocumento = (System.Int32)reader["ID_DOCUMENTO"];
			entity.NumeroOrden = (System.Int32)reader[((int)PatOrdenTrabajoColumn.NumeroOrden - 1)];
			entity.OriginalNumeroOrden = (System.Int32)reader["NUMERO_ORDEN"];
			entity.IdVehiculo = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdVehiculo - 1)];
			entity.IdCliente = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdCliente - 1)];
			entity.IdTipoPropietario = (System.Int16)reader[((int)PatOrdenTrabajoColumn.IdTipoPropietario - 1)];
			entity.IdEstadoOrden = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdEstadoOrden - 1)];
			entity.IdCargoOrden = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdCargoOrden - 1)];
			entity.IdTrabajo = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdTrabajo - 1)];
			entity.FechaEntrada = (System.DateTime)reader[((int)PatOrdenTrabajoColumn.FechaEntrada - 1)];
			entity.HoraEntrada = (System.DateTime)reader[((int)PatOrdenTrabajoColumn.HoraEntrada - 1)];
			entity.FechaCreacion = (System.DateTime)reader[((int)PatOrdenTrabajoColumn.FechaCreacion - 1)];
			entity.FechaEstimadaEntrega = (System.DateTime)reader[((int)PatOrdenTrabajoColumn.FechaEstimadaEntrega - 1)];
			entity.HoraEstimadaEntrega = (System.DateTime)reader[((int)PatOrdenTrabajoColumn.HoraEstimadaEntrega - 1)];
			entity.FechaSalidaTaller = (reader.IsDBNull(((int)PatOrdenTrabajoColumn.FechaSalidaTaller - 1)))?null:(System.DateTime?)reader[((int)PatOrdenTrabajoColumn.FechaSalidaTaller - 1)];
			entity.NumeroEntrada = (System.Int32)reader[((int)PatOrdenTrabajoColumn.NumeroEntrada - 1)];
			entity.KilometrajeEntrada = (System.Int32)reader[((int)PatOrdenTrabajoColumn.KilometrajeEntrada - 1)];
			entity.IdRecepcionista = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdRecepcionista - 1)];
			entity.IdTaller = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdTaller - 1)];
			entity.NumeroLocker = (reader.IsDBNull(((int)PatOrdenTrabajoColumn.NumeroLocker - 1)))?null:(System.Int32?)reader[((int)PatOrdenTrabajoColumn.NumeroLocker - 1)];
			entity.ObservacionesRecepcionista = (System.String)reader[((int)PatOrdenTrabajoColumn.ObservacionesRecepcionista - 1)];
			entity.ObservacionesCliente = (System.String)reader[((int)PatOrdenTrabajoColumn.ObservacionesCliente - 1)];
			entity.IdListaPrecios = (System.Int32)reader[((int)PatOrdenTrabajoColumn.IdListaPrecios - 1)];
			entity.IdNivelCombustible = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdNivelCombustible - 1)];
			entity.IdEstadoCita = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdEstadoCita - 1)];
			entity.FechaLiquidacion = (reader.IsDBNull(((int)PatOrdenTrabajoColumn.FechaLiquidacion - 1)))?null:(System.DateTime?)reader[((int)PatOrdenTrabajoColumn.FechaLiquidacion - 1)];
			entity.AceptaEncuesta = (System.Boolean)reader[((int)PatOrdenTrabajoColumn.AceptaEncuesta - 1)];
			entity.VehiculoInspeccionadoElevador = (System.Boolean)reader[((int)PatOrdenTrabajoColumn.VehiculoInspeccionadoElevador - 1)];
			entity.EntregaPresupuesto = (System.Boolean)reader[((int)PatOrdenTrabajoColumn.EntregaPresupuesto - 1)];
			entity.IdEstadoLiquidacion = (System.Byte)reader[((int)PatOrdenTrabajoColumn.IdEstadoLiquidacion - 1)];
			entity.EsCotizacion = (System.Boolean)reader[((int)PatOrdenTrabajoColumn.EsCotizacion - 1)];
			entity.Activo = (System.Boolean)reader[((int)PatOrdenTrabajoColumn.Activo - 1)];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="PAT.Entities.PatOrdenTrabajo"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatOrdenTrabajo"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, PAT.Entities.PatOrdenTrabajo entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.IdDocumento = (System.Int32)dataRow["ID_DOCUMENTO"];
			entity.OriginalIdDocumento = (System.Int32)dataRow["ID_DOCUMENTO"];
			entity.NumeroOrden = (System.Int32)dataRow["NUMERO_ORDEN"];
			entity.OriginalNumeroOrden = (System.Int32)dataRow["NUMERO_ORDEN"];
			entity.IdVehiculo = (System.Int32)dataRow["ID_VEHICULO"];
			entity.IdCliente = (System.Int32)dataRow["ID_CLIENTE"];
			entity.IdTipoPropietario = (System.Int16)dataRow["ID_TIPO_PROPIETARIO"];
			entity.IdEstadoOrden = (System.Byte)dataRow["ID_ESTADO_ORDEN"];
			entity.IdCargoOrden = (System.Byte)dataRow["ID_CARGO_ORDEN"];
			entity.IdTrabajo = (System.Byte)dataRow["ID_TRABAJO"];
			entity.FechaEntrada = (System.DateTime)dataRow["FECHA_ENTRADA"];
			entity.HoraEntrada = (System.DateTime)dataRow["HORA_ENTRADA"];
			entity.FechaCreacion = (System.DateTime)dataRow["FECHA_CREACION"];
			entity.FechaEstimadaEntrega = (System.DateTime)dataRow["FECHA_ESTIMADA_ENTREGA"];
			entity.HoraEstimadaEntrega = (System.DateTime)dataRow["HORA_ESTIMADA_ENTREGA"];
			entity.FechaSalidaTaller = Convert.IsDBNull(dataRow["FECHA_SALIDA_TALLER"]) ? null : (System.DateTime?)dataRow["FECHA_SALIDA_TALLER"];
			entity.NumeroEntrada = (System.Int32)dataRow["NUMERO_ENTRADA"];
			entity.KilometrajeEntrada = (System.Int32)dataRow["KILOMETRAJE_ENTRADA"];
			entity.IdRecepcionista = (System.Int32)dataRow["ID_RECEPCIONISTA"];
			entity.IdTaller = (System.Int32)dataRow["ID_TALLER"];
			entity.NumeroLocker = Convert.IsDBNull(dataRow["NUMERO_LOCKER"]) ? null : (System.Int32?)dataRow["NUMERO_LOCKER"];
			entity.ObservacionesRecepcionista = (System.String)dataRow["OBSERVACIONES_RECEPCIONISTA"];
			entity.ObservacionesCliente = (System.String)dataRow["OBSERVACIONES_CLIENTE"];
			entity.IdListaPrecios = (System.Int32)dataRow["ID_LISTA_PRECIOS"];
			entity.IdNivelCombustible = (System.Byte)dataRow["ID_NIVEL_COMBUSTIBLE"];
			entity.IdEstadoCita = (System.Byte)dataRow["ID_ESTADO_CITA"];
			entity.FechaLiquidacion = Convert.IsDBNull(dataRow["FECHA_LIQUIDACION"]) ? null : (System.DateTime?)dataRow["FECHA_LIQUIDACION"];
			entity.AceptaEncuesta = (System.Boolean)dataRow["ACEPTA_ENCUESTA"];
			entity.VehiculoInspeccionadoElevador = (System.Boolean)dataRow["VEHICULO_INSPECCIONADO_ELEVADOR"];
			entity.EntregaPresupuesto = (System.Boolean)dataRow["ENTREGA_PRESUPUESTO"];
			entity.IdEstadoLiquidacion = (System.Byte)dataRow["ID_ESTADO_LIQUIDACION"];
			entity.EsCotizacion = (System.Boolean)dataRow["ES_COTIZACION"];
			entity.Activo = (System.Boolean)dataRow["ACTIVO"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatOrdenTrabajo"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">PAT.Entities.PatOrdenTrabajo Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		public override void DeepLoad(TransactionManager transactionManager, PAT.Entities.PatOrdenTrabajo entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;

			#region IdCargoOrdenSource	
			if (CanDeepLoad(entity, "PatCargoOrden|IdCargoOrdenSource", deepLoadType, innerList) 
				&& entity.IdCargoOrdenSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdCargoOrden;
				PatCargoOrden tmpEntity = EntityManager.LocateEntity<PatCargoOrden>(EntityLocator.ConstructKeyFromPkItems(typeof(PatCargoOrden), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdCargoOrdenSource = tmpEntity;
				else
					entity.IdCargoOrdenSource = DataRepository.PatCargoOrdenProvider.GetByIdCargoOrden(transactionManager, entity.IdCargoOrden);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdCargoOrdenSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdCargoOrdenSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatCargoOrdenProvider.DeepLoad(transactionManager, entity.IdCargoOrdenSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdCargoOrdenSource

			#region IdClienteSource	
			if (CanDeepLoad(entity, "PatCliente|IdClienteSource", deepLoadType, innerList) 
				&& entity.IdClienteSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdCliente;
				PatCliente tmpEntity = EntityManager.LocateEntity<PatCliente>(EntityLocator.ConstructKeyFromPkItems(typeof(PatCliente), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdClienteSource = tmpEntity;
				else
					entity.IdClienteSource = DataRepository.PatClienteProvider.GetByIdCliente(transactionManager, entity.IdCliente);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdClienteSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdClienteSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatClienteProvider.DeepLoad(transactionManager, entity.IdClienteSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdClienteSource

			#region IdDocumentoSource	
			if (CanDeepLoad(entity, "PatDocumento|IdDocumentoSource", deepLoadType, innerList) 
				&& entity.IdDocumentoSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdDocumento;
				PatDocumento tmpEntity = EntityManager.LocateEntity<PatDocumento>(EntityLocator.ConstructKeyFromPkItems(typeof(PatDocumento), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdDocumentoSource = tmpEntity;
				else
					entity.IdDocumentoSource = DataRepository.PatDocumentoProvider.GetByIdDocumento(transactionManager, entity.IdDocumento);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdDocumentoSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdDocumentoSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatDocumentoProvider.DeepLoad(transactionManager, entity.IdDocumentoSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdDocumentoSource

			#region IdRecepcionistaSource	
			if (CanDeepLoad(entity, "PatEmpleado|IdRecepcionistaSource", deepLoadType, innerList) 
				&& entity.IdRecepcionistaSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdRecepcionista;
				PatEmpleado tmpEntity = EntityManager.LocateEntity<PatEmpleado>(EntityLocator.ConstructKeyFromPkItems(typeof(PatEmpleado), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdRecepcionistaSource = tmpEntity;
				else
					entity.IdRecepcionistaSource = DataRepository.PatEmpleadoProvider.GetByIdEmpleado(transactionManager, entity.IdRecepcionista);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdRecepcionistaSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdRecepcionistaSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatEmpleadoProvider.DeepLoad(transactionManager, entity.IdRecepcionistaSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdRecepcionistaSource

			#region IdEstadoCitaSource	
			if (CanDeepLoad(entity, "PatEstadoCita|IdEstadoCitaSource", deepLoadType, innerList) 
				&& entity.IdEstadoCitaSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdEstadoCita;
				PatEstadoCita tmpEntity = EntityManager.LocateEntity<PatEstadoCita>(EntityLocator.ConstructKeyFromPkItems(typeof(PatEstadoCita), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdEstadoCitaSource = tmpEntity;
				else
					entity.IdEstadoCitaSource = DataRepository.PatEstadoCitaProvider.GetByIdEstadoCita(transactionManager, entity.IdEstadoCita);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdEstadoCitaSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdEstadoCitaSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatEstadoCitaProvider.DeepLoad(transactionManager, entity.IdEstadoCitaSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdEstadoCitaSource

			#region IdEstadoLiquidacionSource	
			if (CanDeepLoad(entity, "PatEstadoLiquidacion|IdEstadoLiquidacionSource", deepLoadType, innerList) 
				&& entity.IdEstadoLiquidacionSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdEstadoLiquidacion;
				PatEstadoLiquidacion tmpEntity = EntityManager.LocateEntity<PatEstadoLiquidacion>(EntityLocator.ConstructKeyFromPkItems(typeof(PatEstadoLiquidacion), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdEstadoLiquidacionSource = tmpEntity;
				else
					entity.IdEstadoLiquidacionSource = DataRepository.PatEstadoLiquidacionProvider.GetByIdEstadoLiquidacion(transactionManager, entity.IdEstadoLiquidacion);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdEstadoLiquidacionSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdEstadoLiquidacionSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatEstadoLiquidacionProvider.DeepLoad(transactionManager, entity.IdEstadoLiquidacionSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdEstadoLiquidacionSource

			#region IdEstadoOrdenSource	
			if (CanDeepLoad(entity, "PatEstadoOrden|IdEstadoOrdenSource", deepLoadType, innerList) 
				&& entity.IdEstadoOrdenSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdEstadoOrden;
				PatEstadoOrden tmpEntity = EntityManager.LocateEntity<PatEstadoOrden>(EntityLocator.ConstructKeyFromPkItems(typeof(PatEstadoOrden), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdEstadoOrdenSource = tmpEntity;
				else
					entity.IdEstadoOrdenSource = DataRepository.PatEstadoOrdenProvider.GetByIdEstadoOrden(transactionManager, entity.IdEstadoOrden);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdEstadoOrdenSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdEstadoOrdenSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatEstadoOrdenProvider.DeepLoad(transactionManager, entity.IdEstadoOrdenSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdEstadoOrdenSource

			#region IdListaPreciosSource	
			if (CanDeepLoad(entity, "PatListaPreciosTaller|IdListaPreciosSource", deepLoadType, innerList) 
				&& entity.IdListaPreciosSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdListaPrecios;
				PatListaPreciosTaller tmpEntity = EntityManager.LocateEntity<PatListaPreciosTaller>(EntityLocator.ConstructKeyFromPkItems(typeof(PatListaPreciosTaller), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdListaPreciosSource = tmpEntity;
				else
					entity.IdListaPreciosSource = DataRepository.PatListaPreciosTallerProvider.GetByIdListaPrecios(transactionManager, entity.IdListaPrecios);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdListaPreciosSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdListaPreciosSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatListaPreciosTallerProvider.DeepLoad(transactionManager, entity.IdListaPreciosSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdListaPreciosSource

			#region IdNivelCombustibleSource	
			if (CanDeepLoad(entity, "PatNivelCombustible|IdNivelCombustibleSource", deepLoadType, innerList) 
				&& entity.IdNivelCombustibleSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdNivelCombustible;
				PatNivelCombustible tmpEntity = EntityManager.LocateEntity<PatNivelCombustible>(EntityLocator.ConstructKeyFromPkItems(typeof(PatNivelCombustible), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdNivelCombustibleSource = tmpEntity;
				else
					entity.IdNivelCombustibleSource = DataRepository.PatNivelCombustibleProvider.GetByIdNivel(transactionManager, entity.IdNivelCombustible);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdNivelCombustibleSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdNivelCombustibleSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatNivelCombustibleProvider.DeepLoad(transactionManager, entity.IdNivelCombustibleSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdNivelCombustibleSource

			#region IdTallerSource	
			if (CanDeepLoad(entity, "PatTaller|IdTallerSource", deepLoadType, innerList) 
				&& entity.IdTallerSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdTaller;
				PatTaller tmpEntity = EntityManager.LocateEntity<PatTaller>(EntityLocator.ConstructKeyFromPkItems(typeof(PatTaller), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdTallerSource = tmpEntity;
				else
					entity.IdTallerSource = DataRepository.PatTallerProvider.GetByIdTaller(transactionManager, entity.IdTaller);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdTallerSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdTallerSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatTallerProvider.DeepLoad(transactionManager, entity.IdTallerSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdTallerSource

			#region IdTipoPropietarioSource	
			if (CanDeepLoad(entity, "PatTipoPropietario|IdTipoPropietarioSource", deepLoadType, innerList) 
				&& entity.IdTipoPropietarioSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdTipoPropietario;
				PatTipoPropietario tmpEntity = EntityManager.LocateEntity<PatTipoPropietario>(EntityLocator.ConstructKeyFromPkItems(typeof(PatTipoPropietario), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdTipoPropietarioSource = tmpEntity;
				else
					entity.IdTipoPropietarioSource = DataRepository.PatTipoPropietarioProvider.GetByIdTipoPropietario(transactionManager, entity.IdTipoPropietario);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdTipoPropietarioSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdTipoPropietarioSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatTipoPropietarioProvider.DeepLoad(transactionManager, entity.IdTipoPropietarioSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdTipoPropietarioSource

			#region IdTrabajoSource	
			if (CanDeepLoad(entity, "PatTrabajoOrden|IdTrabajoSource", deepLoadType, innerList) 
				&& entity.IdTrabajoSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdTrabajo;
				PatTrabajoOrden tmpEntity = EntityManager.LocateEntity<PatTrabajoOrden>(EntityLocator.ConstructKeyFromPkItems(typeof(PatTrabajoOrden), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdTrabajoSource = tmpEntity;
				else
					entity.IdTrabajoSource = DataRepository.PatTrabajoOrdenProvider.GetByIdTrabajo(transactionManager, entity.IdTrabajo);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdTrabajoSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdTrabajoSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatTrabajoOrdenProvider.DeepLoad(transactionManager, entity.IdTrabajoSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdTrabajoSource

			#region IdVehiculoSource	
			if (CanDeepLoad(entity, "PatVehiculo|IdVehiculoSource", deepLoadType, innerList) 
				&& entity.IdVehiculoSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdVehiculo;
				PatVehiculo tmpEntity = EntityManager.LocateEntity<PatVehiculo>(EntityLocator.ConstructKeyFromPkItems(typeof(PatVehiculo), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdVehiculoSource = tmpEntity;
				else
					entity.IdVehiculoSource = DataRepository.PatVehiculoProvider.GetByIdVehiculo(transactionManager, entity.IdVehiculo);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdVehiculoSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdVehiculoSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatVehiculoProvider.DeepLoad(transactionManager, entity.IdVehiculoSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdVehiculoSource
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			// Deep load child collections  - Call GetByIdDocumentoNumeroOrden methods when available
			
			#region IdKitPatKitCollection_From_PatOrdenTrabajoKit
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatKit>|IdKitPatKitCollection_From_PatOrdenTrabajoKit", deepLoadType, innerList))
			{
				entity.IdKitPatKitCollection_From_PatOrdenTrabajoKit = DataRepository.PatKitProvider.GetByIdDocumentoNumeroOrdenFromPatOrdenTrabajoKit(transactionManager, entity.IdDocumento, entity.NumeroOrden);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdKitPatKitCollection_From_PatOrdenTrabajoKit' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdKitPatKitCollection_From_PatOrdenTrabajoKit != null)
				{
					deepHandles.Add("IdKitPatKitCollection_From_PatOrdenTrabajoKit",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatKit >) DataRepository.PatKitProvider.DeepLoad,
						new object[] { transactionManager, entity.IdKitPatKitCollection_From_PatOrdenTrabajoKit, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region PatOrdenTrabajoGarantia
			// RelationshipType.OneToOne
			if (CanDeepLoad(entity, "PatOrdenTrabajoGarantia|PatOrdenTrabajoGarantia", deepLoadType, innerList))
			{
				entity.PatOrdenTrabajoGarantia = DataRepository.PatOrdenTrabajoGarantiaProvider.GetByIdDocumentoNumeroOrden(transactionManager, entity.IdDocumento, entity.NumeroOrden);
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatOrdenTrabajoGarantia' loaded. key " + entity.EntityTrackingKey);
				#endif 

				if (deep && entity.PatOrdenTrabajoGarantia != null)
				{
					deepHandles.Add("PatOrdenTrabajoGarantia",
						new KeyValuePair<Delegate, object>((DeepLoadSingleHandle< PatOrdenTrabajoGarantia >) DataRepository.PatOrdenTrabajoGarantiaProvider.DeepLoad,
						new object[] { transactionManager, entity.PatOrdenTrabajoGarantia, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion 
			
			
			
			#region IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatTransferencia>|IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia", deepLoadType, innerList))
			{
				entity.IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia = DataRepository.PatTransferenciaProvider.GetByIdDocumentoOrdenNumeroOrdenFromPatOrdenTrabajoTransferencia(transactionManager, entity.IdDocumento, entity.NumeroOrden);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia != null)
				{
					deepHandles.Add("IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatTransferencia >) DataRepository.PatTransferenciaProvider.DeepLoad,
						new object[] { transactionManager, entity.IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatAccesorio>|IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio", deepLoadType, innerList))
			{
				entity.IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio = DataRepository.PatAccesorioProvider.GetByIdDocumentoNumeroOrdenFromPatOrdenTrabajoAccesorio(transactionManager, entity.IdDocumento, entity.NumeroOrden);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio != null)
				{
					deepHandles.Add("IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatAccesorio >) DataRepository.PatAccesorioProvider.DeepLoad,
						new object[] { transactionManager, entity.IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatItemPeritaje>|IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje", deepLoadType, innerList))
			{
				entity.IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje = DataRepository.PatItemPeritajeProvider.GetByIdDocumentoNumeroOrdenFromPatOrdenTrabajoPeritaje(transactionManager, entity.IdDocumento, entity.NumeroOrden);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje != null)
				{
					deepHandles.Add("IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatItemPeritaje >) DataRepository.PatItemPeritajeProvider.DeepLoad,
						new object[] { transactionManager, entity.IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region PatOrdenTrabajoKitCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatOrdenTrabajoKit>|PatOrdenTrabajoKitCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatOrdenTrabajoKitCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatOrdenTrabajoKitCollection = DataRepository.PatOrdenTrabajoKitProvider.GetByIdDocumentoNumeroOrden(transactionManager, entity.IdDocumento, entity.NumeroOrden);

				if (deep && entity.PatOrdenTrabajoKitCollection.Count > 0)
				{
					deepHandles.Add("PatOrdenTrabajoKitCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatOrdenTrabajoKit>) DataRepository.PatOrdenTrabajoKitProvider.DeepLoad,
						new object[] { transactionManager, entity.PatOrdenTrabajoKitCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatOrdenTrabajoPeritajeCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatOrdenTrabajoPeritaje>|PatOrdenTrabajoPeritajeCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatOrdenTrabajoPeritajeCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatOrdenTrabajoPeritajeCollection = DataRepository.PatOrdenTrabajoPeritajeProvider.GetByIdDocumentoNumeroOrden(transactionManager, entity.IdDocumento, entity.NumeroOrden);

				if (deep && entity.PatOrdenTrabajoPeritajeCollection.Count > 0)
				{
					deepHandles.Add("PatOrdenTrabajoPeritajeCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatOrdenTrabajoPeritaje>) DataRepository.PatOrdenTrabajoPeritajeProvider.DeepLoad,
						new object[] { transactionManager, entity.PatOrdenTrabajoPeritajeCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatTempario>|IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion", deepLoadType, innerList))
			{
				entity.IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion = DataRepository.PatTemparioProvider.GetByIdDocumentoNumeroOrdenFromPatOrdenTrabajoOperacion(transactionManager, entity.IdDocumento, entity.NumeroOrden);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion != null)
				{
					deepHandles.Add("IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatTempario >) DataRepository.PatTemparioProvider.DeepLoad,
						new object[] { transactionManager, entity.IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region PatOrdenTrabajoSeguros
			// RelationshipType.OneToOne
			if (CanDeepLoad(entity, "PatOrdenTrabajoSeguros|PatOrdenTrabajoSeguros", deepLoadType, innerList))
			{
				entity.PatOrdenTrabajoSeguros = DataRepository.PatOrdenTrabajoSegurosProvider.GetByIdDocumentoNumeroOrden(transactionManager, entity.IdDocumento, entity.NumeroOrden);
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatOrdenTrabajoSeguros' loaded. key " + entity.EntityTrackingKey);
				#endif 

				if (deep && entity.PatOrdenTrabajoSeguros != null)
				{
					deepHandles.Add("PatOrdenTrabajoSeguros",
						new KeyValuePair<Delegate, object>((DeepLoadSingleHandle< PatOrdenTrabajoSeguros >) DataRepository.PatOrdenTrabajoSegurosProvider.DeepLoad,
						new object[] { transactionManager, entity.PatOrdenTrabajoSeguros, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion 
			
			
			
			#region PatOrdenTrabajoTransferenciaCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatOrdenTrabajoTransferencia>|PatOrdenTrabajoTransferenciaCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatOrdenTrabajoTransferenciaCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatOrdenTrabajoTransferenciaCollection = DataRepository.PatOrdenTrabajoTransferenciaProvider.GetByIdDocumentoOrdenNumeroOrden(transactionManager, entity.IdDocumento, entity.NumeroOrden);

				if (deep && entity.PatOrdenTrabajoTransferenciaCollection.Count > 0)
				{
					deepHandles.Add("PatOrdenTrabajoTransferenciaCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatOrdenTrabajoTransferencia>) DataRepository.PatOrdenTrabajoTransferenciaProvider.DeepLoad,
						new object[] { transactionManager, entity.PatOrdenTrabajoTransferenciaCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatOrdenTrabajoOperacionCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatOrdenTrabajoOperacion>|PatOrdenTrabajoOperacionCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatOrdenTrabajoOperacionCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatOrdenTrabajoOperacionCollection = DataRepository.PatOrdenTrabajoOperacionProvider.GetByIdDocumentoNumeroOrden(transactionManager, entity.IdDocumento, entity.NumeroOrden);

				if (deep && entity.PatOrdenTrabajoOperacionCollection.Count > 0)
				{
					deepHandles.Add("PatOrdenTrabajoOperacionCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatOrdenTrabajoOperacion>) DataRepository.PatOrdenTrabajoOperacionProvider.DeepLoad,
						new object[] { transactionManager, entity.PatOrdenTrabajoOperacionCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatOrdenTrabajoAccesorioCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatOrdenTrabajoAccesorio>|PatOrdenTrabajoAccesorioCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatOrdenTrabajoAccesorioCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatOrdenTrabajoAccesorioCollection = DataRepository.PatOrdenTrabajoAccesorioProvider.GetByIdDocumentoNumeroOrden(transactionManager, entity.IdDocumento, entity.NumeroOrden);

				if (deep && entity.PatOrdenTrabajoAccesorioCollection.Count > 0)
				{
					deepHandles.Add("PatOrdenTrabajoAccesorioCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatOrdenTrabajoAccesorio>) DataRepository.PatOrdenTrabajoAccesorioProvider.DeepLoad,
						new object[] { transactionManager, entity.PatOrdenTrabajoAccesorioCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the PAT.Entities.PatOrdenTrabajo object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">PAT.Entities.PatOrdenTrabajo instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">PAT.Entities.PatOrdenTrabajo Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		public override bool DeepSave(TransactionManager transactionManager, PAT.Entities.PatOrdenTrabajo entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			
			#region IdCargoOrdenSource
			if (CanDeepSave(entity, "PatCargoOrden|IdCargoOrdenSource", deepSaveType, innerList) 
				&& entity.IdCargoOrdenSource != null)
			{
				DataRepository.PatCargoOrdenProvider.Save(transactionManager, entity.IdCargoOrdenSource);
				entity.IdCargoOrden = entity.IdCargoOrdenSource.IdCargoOrden;
			}
			#endregion 
			
			#region IdClienteSource
			if (CanDeepSave(entity, "PatCliente|IdClienteSource", deepSaveType, innerList) 
				&& entity.IdClienteSource != null)
			{
				DataRepository.PatClienteProvider.Save(transactionManager, entity.IdClienteSource);
				entity.IdCliente = entity.IdClienteSource.IdCliente;
			}
			#endregion 
			
			#region IdDocumentoSource
			if (CanDeepSave(entity, "PatDocumento|IdDocumentoSource", deepSaveType, innerList) 
				&& entity.IdDocumentoSource != null)
			{
				DataRepository.PatDocumentoProvider.Save(transactionManager, entity.IdDocumentoSource);
				entity.IdDocumento = entity.IdDocumentoSource.IdDocumento;
			}
			#endregion 
			
			#region IdRecepcionistaSource
			if (CanDeepSave(entity, "PatEmpleado|IdRecepcionistaSource", deepSaveType, innerList) 
				&& entity.IdRecepcionistaSource != null)
			{
				DataRepository.PatEmpleadoProvider.Save(transactionManager, entity.IdRecepcionistaSource);
				entity.IdRecepcionista = entity.IdRecepcionistaSource.IdEmpleado;
			}
			#endregion 
			
			#region IdEstadoCitaSource
			if (CanDeepSave(entity, "PatEstadoCita|IdEstadoCitaSource", deepSaveType, innerList) 
				&& entity.IdEstadoCitaSource != null)
			{
				DataRepository.PatEstadoCitaProvider.Save(transactionManager, entity.IdEstadoCitaSource);
				entity.IdEstadoCita = entity.IdEstadoCitaSource.IdEstadoCita;
			}
			#endregion 
			
			#region IdEstadoLiquidacionSource
			if (CanDeepSave(entity, "PatEstadoLiquidacion|IdEstadoLiquidacionSource", deepSaveType, innerList) 
				&& entity.IdEstadoLiquidacionSource != null)
			{
				DataRepository.PatEstadoLiquidacionProvider.Save(transactionManager, entity.IdEstadoLiquidacionSource);
				entity.IdEstadoLiquidacion = entity.IdEstadoLiquidacionSource.IdEstadoLiquidacion;
			}
			#endregion 
			
			#region IdEstadoOrdenSource
			if (CanDeepSave(entity, "PatEstadoOrden|IdEstadoOrdenSource", deepSaveType, innerList) 
				&& entity.IdEstadoOrdenSource != null)
			{
				DataRepository.PatEstadoOrdenProvider.Save(transactionManager, entity.IdEstadoOrdenSource);
				entity.IdEstadoOrden = entity.IdEstadoOrdenSource.IdEstadoOrden;
			}
			#endregion 
			
			#region IdListaPreciosSource
			if (CanDeepSave(entity, "PatListaPreciosTaller|IdListaPreciosSource", deepSaveType, innerList) 
				&& entity.IdListaPreciosSource != null)
			{
				DataRepository.PatListaPreciosTallerProvider.Save(transactionManager, entity.IdListaPreciosSource);
				entity.IdListaPrecios = entity.IdListaPreciosSource.IdListaPrecios;
			}
			#endregion 
			
			#region IdNivelCombustibleSource
			if (CanDeepSave(entity, "PatNivelCombustible|IdNivelCombustibleSource", deepSaveType, innerList) 
				&& entity.IdNivelCombustibleSource != null)
			{
				DataRepository.PatNivelCombustibleProvider.Save(transactionManager, entity.IdNivelCombustibleSource);
				entity.IdNivelCombustible = entity.IdNivelCombustibleSource.IdNivel;
			}
			#endregion 
			
			#region IdTallerSource
			if (CanDeepSave(entity, "PatTaller|IdTallerSource", deepSaveType, innerList) 
				&& entity.IdTallerSource != null)
			{
				DataRepository.PatTallerProvider.Save(transactionManager, entity.IdTallerSource);
				entity.IdTaller = entity.IdTallerSource.IdTaller;
			}
			#endregion 
			
			#region IdTipoPropietarioSource
			if (CanDeepSave(entity, "PatTipoPropietario|IdTipoPropietarioSource", deepSaveType, innerList) 
				&& entity.IdTipoPropietarioSource != null)
			{
				DataRepository.PatTipoPropietarioProvider.Save(transactionManager, entity.IdTipoPropietarioSource);
				entity.IdTipoPropietario = entity.IdTipoPropietarioSource.IdTipoPropietario;
			}
			#endregion 
			
			#region IdTrabajoSource
			if (CanDeepSave(entity, "PatTrabajoOrden|IdTrabajoSource", deepSaveType, innerList) 
				&& entity.IdTrabajoSource != null)
			{
				DataRepository.PatTrabajoOrdenProvider.Save(transactionManager, entity.IdTrabajoSource);
				entity.IdTrabajo = entity.IdTrabajoSource.IdTrabajo;
			}
			#endregion 
			
			#region IdVehiculoSource
			if (CanDeepSave(entity, "PatVehiculo|IdVehiculoSource", deepSaveType, innerList) 
				&& entity.IdVehiculoSource != null)
			{
				DataRepository.PatVehiculoProvider.Save(transactionManager, entity.IdVehiculoSource);
				entity.IdVehiculo = entity.IdVehiculoSource.IdVehiculo;
			}
			#endregion 
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();

			#region PatOrdenTrabajoGarantia
			if (CanDeepSave(entity.PatOrdenTrabajoGarantia, "PatOrdenTrabajoGarantia|PatOrdenTrabajoGarantia", deepSaveType, innerList))
			{

				if (entity.PatOrdenTrabajoGarantia != null)
				{
					// update each child parent id with the real parent id (mostly used on insert)

					entity.PatOrdenTrabajoGarantia.IdDocumento = entity.IdDocumento;

					entity.PatOrdenTrabajoGarantia.NumeroOrden = entity.NumeroOrden;
					//DataRepository.PatOrdenTrabajoGarantiaProvider.Save(transactionManager, entity.PatOrdenTrabajoGarantia);
					deepHandles.Add("PatOrdenTrabajoGarantia",
						new KeyValuePair<Delegate, object>((DeepSaveSingleHandle< PatOrdenTrabajoGarantia >) DataRepository.PatOrdenTrabajoGarantiaProvider.DeepSave,
						new object[] { transactionManager, entity.PatOrdenTrabajoGarantia, deepSaveType, childTypes, innerList }
					));
				}
			} 
			#endregion 

			#region PatOrdenTrabajoSeguros
			if (CanDeepSave(entity.PatOrdenTrabajoSeguros, "PatOrdenTrabajoSeguros|PatOrdenTrabajoSeguros", deepSaveType, innerList))
			{

				if (entity.PatOrdenTrabajoSeguros != null)
				{
					// update each child parent id with the real parent id (mostly used on insert)

					entity.PatOrdenTrabajoSeguros.IdDocumento = entity.IdDocumento;

					entity.PatOrdenTrabajoSeguros.NumeroOrden = entity.NumeroOrden;
					//DataRepository.PatOrdenTrabajoSegurosProvider.Save(transactionManager, entity.PatOrdenTrabajoSeguros);
					deepHandles.Add("PatOrdenTrabajoSeguros",
						new KeyValuePair<Delegate, object>((DeepSaveSingleHandle< PatOrdenTrabajoSeguros >) DataRepository.PatOrdenTrabajoSegurosProvider.DeepSave,
						new object[] { transactionManager, entity.PatOrdenTrabajoSeguros, deepSaveType, childTypes, innerList }
					));
				}
			} 
			#endregion 

			#region IdKitPatKitCollection_From_PatOrdenTrabajoKit>
			if (CanDeepSave(entity.IdKitPatKitCollection_From_PatOrdenTrabajoKit, "List<PatKit>|IdKitPatKitCollection_From_PatOrdenTrabajoKit", deepSaveType, innerList))
			{
				if (entity.IdKitPatKitCollection_From_PatOrdenTrabajoKit.Count > 0 || entity.IdKitPatKitCollection_From_PatOrdenTrabajoKit.DeletedItems.Count > 0)
				{
					DataRepository.PatKitProvider.Save(transactionManager, entity.IdKitPatKitCollection_From_PatOrdenTrabajoKit); 
					deepHandles.Add("IdKitPatKitCollection_From_PatOrdenTrabajoKit",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatKit>) DataRepository.PatKitProvider.DeepSave,
						new object[] { transactionManager, entity.IdKitPatKitCollection_From_PatOrdenTrabajoKit, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia>
			if (CanDeepSave(entity.IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia, "List<PatTransferencia>|IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia", deepSaveType, innerList))
			{
				if (entity.IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia.Count > 0 || entity.IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia.DeletedItems.Count > 0)
				{
					DataRepository.PatTransferenciaProvider.Save(transactionManager, entity.IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia); 
					deepHandles.Add("IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatTransferencia>) DataRepository.PatTransferenciaProvider.DeepSave,
						new object[] { transactionManager, entity.IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio>
			if (CanDeepSave(entity.IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio, "List<PatAccesorio>|IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio", deepSaveType, innerList))
			{
				if (entity.IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio.Count > 0 || entity.IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio.DeletedItems.Count > 0)
				{
					DataRepository.PatAccesorioProvider.Save(transactionManager, entity.IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio); 
					deepHandles.Add("IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatAccesorio>) DataRepository.PatAccesorioProvider.DeepSave,
						new object[] { transactionManager, entity.IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje>
			if (CanDeepSave(entity.IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje, "List<PatItemPeritaje>|IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje", deepSaveType, innerList))
			{
				if (entity.IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje.Count > 0 || entity.IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje.DeletedItems.Count > 0)
				{
					DataRepository.PatItemPeritajeProvider.Save(transactionManager, entity.IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje); 
					deepHandles.Add("IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatItemPeritaje>) DataRepository.PatItemPeritajeProvider.DeepSave,
						new object[] { transactionManager, entity.IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion>
			if (CanDeepSave(entity.IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion, "List<PatTempario>|IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion", deepSaveType, innerList))
			{
				if (entity.IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion.Count > 0 || entity.IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion.DeletedItems.Count > 0)
				{
					DataRepository.PatTemparioProvider.Save(transactionManager, entity.IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion); 
					deepHandles.Add("IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatTempario>) DataRepository.PatTemparioProvider.DeepSave,
						new object[] { transactionManager, entity.IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 
	
			#region List<PatOrdenTrabajoKit>
				if (CanDeepSave(entity.PatOrdenTrabajoKitCollection, "List<PatOrdenTrabajoKit>|PatOrdenTrabajoKitCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatOrdenTrabajoKit child in entity.PatOrdenTrabajoKitCollection)
					{
						if(child.IdDocumentoNumeroOrdenSource != null)
						{
								child.IdDocumento = child.IdDocumentoNumeroOrdenSource.IdDocumento;
								child.NumeroOrden = child.IdDocumentoNumeroOrdenSource.NumeroOrden;
						}

						if(child.IdKitSource != null)
						{
								child.IdKit = child.IdKitSource.IdKit;
						}

					}

					if (entity.PatOrdenTrabajoKitCollection.Count > 0 || entity.PatOrdenTrabajoKitCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatOrdenTrabajoKitProvider.Save(transactionManager, entity.PatOrdenTrabajoKitCollection);
						
						deepHandles.Add("PatOrdenTrabajoKitCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatOrdenTrabajoKit >) DataRepository.PatOrdenTrabajoKitProvider.DeepSave,
							new object[] { transactionManager, entity.PatOrdenTrabajoKitCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatOrdenTrabajoPeritaje>
				if (CanDeepSave(entity.PatOrdenTrabajoPeritajeCollection, "List<PatOrdenTrabajoPeritaje>|PatOrdenTrabajoPeritajeCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatOrdenTrabajoPeritaje child in entity.PatOrdenTrabajoPeritajeCollection)
					{
						if(child.IdDocumentoNumeroOrdenSource != null)
						{
								child.IdDocumento = child.IdDocumentoNumeroOrdenSource.IdDocumento;
								child.NumeroOrden = child.IdDocumentoNumeroOrdenSource.NumeroOrden;
						}

						if(child.IdGrupoPeritajeIdItemPeritajeSource != null)
						{
								child.IdGrupoPeritaje = child.IdGrupoPeritajeIdItemPeritajeSource.IdGrupoPeritaje;
								child.IdItemPeritaje = child.IdGrupoPeritajeIdItemPeritajeSource.IdItemPeritaje;
						}

					}

					if (entity.PatOrdenTrabajoPeritajeCollection.Count > 0 || entity.PatOrdenTrabajoPeritajeCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatOrdenTrabajoPeritajeProvider.Save(transactionManager, entity.PatOrdenTrabajoPeritajeCollection);
						
						deepHandles.Add("PatOrdenTrabajoPeritajeCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatOrdenTrabajoPeritaje >) DataRepository.PatOrdenTrabajoPeritajeProvider.DeepSave,
							new object[] { transactionManager, entity.PatOrdenTrabajoPeritajeCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatOrdenTrabajoTransferencia>
				if (CanDeepSave(entity.PatOrdenTrabajoTransferenciaCollection, "List<PatOrdenTrabajoTransferencia>|PatOrdenTrabajoTransferenciaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatOrdenTrabajoTransferencia child in entity.PatOrdenTrabajoTransferenciaCollection)
					{
						if(child.IdDocumentoOrdenNumeroOrdenSource != null)
						{
								child.IdDocumentoOrden = child.IdDocumentoOrdenNumeroOrdenSource.IdDocumento;
								child.NumeroOrden = child.IdDocumentoOrdenNumeroOrdenSource.NumeroOrden;
						}

						if(child.IdDocumentoTransferenciaNumeroTransferenciaSource != null)
						{
								child.IdDocumentoTransferencia = child.IdDocumentoTransferenciaNumeroTransferenciaSource.IdDocumento;
								child.NumeroTransferencia = child.IdDocumentoTransferenciaNumeroTransferenciaSource.NumeroTransferencia;
						}

					}

					if (entity.PatOrdenTrabajoTransferenciaCollection.Count > 0 || entity.PatOrdenTrabajoTransferenciaCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatOrdenTrabajoTransferenciaProvider.Save(transactionManager, entity.PatOrdenTrabajoTransferenciaCollection);
						
						deepHandles.Add("PatOrdenTrabajoTransferenciaCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatOrdenTrabajoTransferencia >) DataRepository.PatOrdenTrabajoTransferenciaProvider.DeepSave,
							new object[] { transactionManager, entity.PatOrdenTrabajoTransferenciaCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatOrdenTrabajoOperacion>
				if (CanDeepSave(entity.PatOrdenTrabajoOperacionCollection, "List<PatOrdenTrabajoOperacion>|PatOrdenTrabajoOperacionCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatOrdenTrabajoOperacion child in entity.PatOrdenTrabajoOperacionCollection)
					{
						if(child.IdDocumentoNumeroOrdenSource != null)
						{
								child.IdDocumento = child.IdDocumentoNumeroOrdenSource.IdDocumento;
								child.NumeroOrden = child.IdDocumentoNumeroOrdenSource.NumeroOrden;
						}

						if(child.IdOperacionSource != null)
						{
								child.IdOperacion = child.IdOperacionSource.IdOperacion;
						}

					}

					if (entity.PatOrdenTrabajoOperacionCollection.Count > 0 || entity.PatOrdenTrabajoOperacionCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatOrdenTrabajoOperacionProvider.Save(transactionManager, entity.PatOrdenTrabajoOperacionCollection);
						
						deepHandles.Add("PatOrdenTrabajoOperacionCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatOrdenTrabajoOperacion >) DataRepository.PatOrdenTrabajoOperacionProvider.DeepSave,
							new object[] { transactionManager, entity.PatOrdenTrabajoOperacionCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatOrdenTrabajoAccesorio>
				if (CanDeepSave(entity.PatOrdenTrabajoAccesorioCollection, "List<PatOrdenTrabajoAccesorio>|PatOrdenTrabajoAccesorioCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatOrdenTrabajoAccesorio child in entity.PatOrdenTrabajoAccesorioCollection)
					{
						if(child.IdDocumentoNumeroOrdenSource != null)
						{
								child.IdDocumento = child.IdDocumentoNumeroOrdenSource.IdDocumento;
								child.NumeroOrden = child.IdDocumentoNumeroOrdenSource.NumeroOrden;
						}

						if(child.IdAccesorioSource != null)
						{
								child.IdAccesorio = child.IdAccesorioSource.IdAccesorio;
						}

					}

					if (entity.PatOrdenTrabajoAccesorioCollection.Count > 0 || entity.PatOrdenTrabajoAccesorioCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatOrdenTrabajoAccesorioProvider.Save(transactionManager, entity.PatOrdenTrabajoAccesorioCollection);
						
						deepHandles.Add("PatOrdenTrabajoAccesorioCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatOrdenTrabajoAccesorio >) DataRepository.PatOrdenTrabajoAccesorioProvider.DeepSave,
							new object[] { transactionManager, entity.PatOrdenTrabajoAccesorioCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region PatOrdenTrabajoChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>PAT.Entities.PatOrdenTrabajo</c>
	///</summary>
	public enum PatOrdenTrabajoChildEntityTypes
	{
		
		///<summary>
		/// Composite Property for <c>PatCargoOrden</c> at IdCargoOrdenSource
		///</summary>
		[ChildEntityType(typeof(PatCargoOrden))]
		PatCargoOrden,
			
		///<summary>
		/// Composite Property for <c>PatCliente</c> at IdClienteSource
		///</summary>
		[ChildEntityType(typeof(PatCliente))]
		PatCliente,
			
		///<summary>
		/// Composite Property for <c>PatDocumento</c> at IdDocumentoSource
		///</summary>
		[ChildEntityType(typeof(PatDocumento))]
		PatDocumento,
			
		///<summary>
		/// Composite Property for <c>PatEmpleado</c> at IdRecepcionistaSource
		///</summary>
		[ChildEntityType(typeof(PatEmpleado))]
		PatEmpleado,
			
		///<summary>
		/// Composite Property for <c>PatEstadoCita</c> at IdEstadoCitaSource
		///</summary>
		[ChildEntityType(typeof(PatEstadoCita))]
		PatEstadoCita,
			
		///<summary>
		/// Composite Property for <c>PatEstadoLiquidacion</c> at IdEstadoLiquidacionSource
		///</summary>
		[ChildEntityType(typeof(PatEstadoLiquidacion))]
		PatEstadoLiquidacion,
			
		///<summary>
		/// Composite Property for <c>PatEstadoOrden</c> at IdEstadoOrdenSource
		///</summary>
		[ChildEntityType(typeof(PatEstadoOrden))]
		PatEstadoOrden,
			
		///<summary>
		/// Composite Property for <c>PatListaPreciosTaller</c> at IdListaPreciosSource
		///</summary>
		[ChildEntityType(typeof(PatListaPreciosTaller))]
		PatListaPreciosTaller,
			
		///<summary>
		/// Composite Property for <c>PatNivelCombustible</c> at IdNivelCombustibleSource
		///</summary>
		[ChildEntityType(typeof(PatNivelCombustible))]
		PatNivelCombustible,
			
		///<summary>
		/// Composite Property for <c>PatTaller</c> at IdTallerSource
		///</summary>
		[ChildEntityType(typeof(PatTaller))]
		PatTaller,
			
		///<summary>
		/// Composite Property for <c>PatTipoPropietario</c> at IdTipoPropietarioSource
		///</summary>
		[ChildEntityType(typeof(PatTipoPropietario))]
		PatTipoPropietario,
			
		///<summary>
		/// Composite Property for <c>PatTrabajoOrden</c> at IdTrabajoSource
		///</summary>
		[ChildEntityType(typeof(PatTrabajoOrden))]
		PatTrabajoOrden,
			
		///<summary>
		/// Composite Property for <c>PatVehiculo</c> at IdVehiculoSource
		///</summary>
		[ChildEntityType(typeof(PatVehiculo))]
		PatVehiculo,
	
		///<summary>
		/// Collection of <c>PatOrdenTrabajo</c> as ManyToMany for PatKitCollection_From_PatOrdenTrabajoKit
		///</summary>
		[ChildEntityType(typeof(TList<PatKit>))]
		IdKitPatKitCollection_From_PatOrdenTrabajoKit,
		///<summary>
		/// Entity <c>PatOrdenTrabajoGarantia</c> as OneToOne for PatOrdenTrabajoGarantia
		///</summary>
		[ChildEntityType(typeof(PatOrdenTrabajoGarantia))]
		PatOrdenTrabajoGarantia,

		///<summary>
		/// Collection of <c>PatOrdenTrabajo</c> as ManyToMany for PatTransferenciaCollection_From_PatOrdenTrabajoTransferencia
		///</summary>
		[ChildEntityType(typeof(TList<PatTransferencia>))]
		IdDocumentoTransferenciaNumeroTransferenciaPatTransferenciaCollection_From_PatOrdenTrabajoTransferencia,

		///<summary>
		/// Collection of <c>PatOrdenTrabajo</c> as ManyToMany for PatAccesorioCollection_From_PatOrdenTrabajoAccesorio
		///</summary>
		[ChildEntityType(typeof(TList<PatAccesorio>))]
		IdAccesorioPatAccesorioCollection_From_PatOrdenTrabajoAccesorio,

		///<summary>
		/// Collection of <c>PatOrdenTrabajo</c> as ManyToMany for PatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje
		///</summary>
		[ChildEntityType(typeof(TList<PatItemPeritaje>))]
		IdGrupoPeritajeIdItemPeritajePatItemPeritajeCollection_From_PatOrdenTrabajoPeritaje,

		///<summary>
		/// Collection of <c>PatOrdenTrabajo</c> as OneToMany for PatOrdenTrabajoKitCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatOrdenTrabajoKit>))]
		PatOrdenTrabajoKitCollection,

		///<summary>
		/// Collection of <c>PatOrdenTrabajo</c> as OneToMany for PatOrdenTrabajoPeritajeCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatOrdenTrabajoPeritaje>))]
		PatOrdenTrabajoPeritajeCollection,

		///<summary>
		/// Collection of <c>PatOrdenTrabajo</c> as ManyToMany for PatTemparioCollection_From_PatOrdenTrabajoOperacion
		///</summary>
		[ChildEntityType(typeof(TList<PatTempario>))]
		IdOperacionPatTemparioCollection_From_PatOrdenTrabajoOperacion,
		///<summary>
		/// Entity <c>PatOrdenTrabajoSeguros</c> as OneToOne for PatOrdenTrabajoSeguros
		///</summary>
		[ChildEntityType(typeof(PatOrdenTrabajoSeguros))]
		PatOrdenTrabajoSeguros,

		///<summary>
		/// Collection of <c>PatOrdenTrabajo</c> as OneToMany for PatOrdenTrabajoTransferenciaCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatOrdenTrabajoTransferencia>))]
		PatOrdenTrabajoTransferenciaCollection,

		///<summary>
		/// Collection of <c>PatOrdenTrabajo</c> as OneToMany for PatOrdenTrabajoOperacionCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatOrdenTrabajoOperacion>))]
		PatOrdenTrabajoOperacionCollection,

		///<summary>
		/// Collection of <c>PatOrdenTrabajo</c> as OneToMany for PatOrdenTrabajoAccesorioCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatOrdenTrabajoAccesorio>))]
		PatOrdenTrabajoAccesorioCollection,
	}
	
	#endregion PatOrdenTrabajoChildEntityTypes
	
	#region PatOrdenTrabajoFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;PatOrdenTrabajoColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatOrdenTrabajo"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatOrdenTrabajoFilterBuilder : SqlFilterBuilder<PatOrdenTrabajoColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatOrdenTrabajoFilterBuilder class.
		/// </summary>
		public PatOrdenTrabajoFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatOrdenTrabajoFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatOrdenTrabajoFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatOrdenTrabajoFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatOrdenTrabajoFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatOrdenTrabajoFilterBuilder
	
	#region PatOrdenTrabajoParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;PatOrdenTrabajoColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatOrdenTrabajo"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatOrdenTrabajoParameterBuilder : ParameterizedSqlFilterBuilder<PatOrdenTrabajoColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatOrdenTrabajoParameterBuilder class.
		/// </summary>
		public PatOrdenTrabajoParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatOrdenTrabajoParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatOrdenTrabajoParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatOrdenTrabajoParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatOrdenTrabajoParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatOrdenTrabajoParameterBuilder
	
	#region PatOrdenTrabajoSortBuilder
    
    /// <summary>
    /// A strongly-typed instance of the <see cref="SqlSortBuilder&lt;PatOrdenTrabajoColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatOrdenTrabajo"/> object.
    /// </summary>
    [CLSCompliant(true)]
    public class PatOrdenTrabajoSortBuilder : SqlSortBuilder<PatOrdenTrabajoColumn>
    {
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatOrdenTrabajoSqlSortBuilder class.
		/// </summary>
		public PatOrdenTrabajoSortBuilder() : base() { }

		#endregion Constructors

    }    
    #endregion PatOrdenTrabajoSortBuilder
	
} // end namespace
